<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%
	/**
	 * @author 谭湘元
	 * @since 2009/04/23
	 */

 %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb18030" />
<fmt:setBundle basename="PathResource" scope="session" />
<title>聋校语言学习及矫治系统</title>
<link href="<%=request.getContextPath() %>/<fmt:message key='StylePath' />style.css" rel="stylesheet" type="text/css" />

<script type="text/javascript">
	
	function addGameType(operateType){
		document.forms[0].action+="&operatorSign=edit";
		var bookTypeId = document.forms[0].gameTypeId.value;
		var name = document.forms[0].name.value;
		
		if(operateType == "modify" && bookTypeId==""){
			alert("请先选择要修改的行！");
			return;
		}
		if(name==""){
			alert("类别名称必须填写！");
			return;
		}
		document.forms[0].submit();
	}
	function toModifyType(id,name,type){
		document.getElementById("addButton").style.display="none";
		document.getElementById("modifyButton").style.display="block";
		
		document.forms[0].gameTypeId.value = id;
		document.forms[0].name.value = name;
		document.forms[0].justDataType.value = type;
	}
	
	function deleteType(id){
		if(confirm("确定要删除？")){
			document.forms[0].action+="&operatorSign=delete";
			document.forms[0].gameTypeId.value = id;
			document.forms[0].submit();
		}
	}
</script>

</head>

<body class="bcolor">
<form id="form1" name="form1" method="post" action="game.do?method=queryGameTypes">
	<input type="hidden" name="gameTypeId" />
  <table width="99%" border="0" align="center" cellpadding="0" cellspacing="1" bordercolor="#FFFFFF" bgcolor="#a7c8e6">
    <tr>
      <td><table width="100%" border="0" align="center" cellpadding="3" cellspacing="0" class="fontbot">
          <tr>
			<td valign="middle" bgcolor="#FFFFFF" width="5%"><input name="name" type="text" class="boxcopy2" id="textfield10" style="width:250px; height:18px;text-valign: bottom;" maxlength="20" /></td>
			<td valign="middle" bgcolor="#FFFFFF" width="5%">
				<select name="justDataType" style="width:130px; height:23px;">
					<option value="">无</option>
					<option value="10">语音大小</option>
					<option value="01">声音有无</option>
					<option value="11">语音大小、声音有无</option>
				</select>
			</td>
			<td valign="middle" bgcolor="#FFFFFF" align="left">
				<a href="#" onfocus="this.blur()">
					<img id="addButton" onclick="addGameType('save');" src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />gif-01.gif" border="0" /> 
					<img id="modifyButton" onclick="addGameType('modify');" style="display:none;" src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />jz_img/xiugai.gif" border="0" />
				</a>
			</td>
		</tr>
      </table></td>
    </tr>
  </table>
  <table cellspacing="0" cellpadding="0" width="99%" align="center" border="0">
    <tbody>
      <tr>
        <td width="7"><img height="38" alt="" src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_01.gif" width="7" /></td>
        <td background="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_05.gif"><table cellspacing="0" cellpadding="0" width="100%" border="0">
            <tbody>
              <tr>
                <td width="30"><img height="38" alt="" src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_02.gif" width="30" /></td>
                <td align="left" width="200"  background="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_03.gif">&nbsp;<strong> 游 戏 类 别</strong></td>
                <td width="59"><img height="38" alt="" src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_04.gif" width="59" /></td>
                <td>&nbsp;</td>
              </tr>
            </tbody>
        </table></td>
        <td width="8"><img height="38" alt="" src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_06.gif" width="8" /></td>
      </tr>
      <tr>
        <td background="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_07.gif"><img height="1" src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />spacer.gif" width="1" /></td>
        <td bgcolor="#f7fbff"><table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#a4c9ec" bordercolorlight="#ffffff">
        <tr bgcolor="#CCDDF2">
          <td width="20" valign="middle">&nbsp;</td>
          <td height="20" align="center" ><strong>类别名称</strong></td>
		  <td height="20" align="center" ><strong>实时数据类型</strong></td>
          <td width="15%" height="20" align="center" ><strong>编 辑</strong></td>
          <td width="15%" align="center" ><strong>删 除</strong></td>
          </tr>
          
		<c:forEach items="${pagenitionModel.resultItems}" var="item" varStatus="status">
        <tr>
          <td height="20" align="center" bgcolor="#FFFFFF"><c:out value="${status.count}"/>.</td>
          <td height="20" align="center" bgcolor="#FFFFFF"><c:out value="${item.name}"/></td>
		  <td height="20" align="center" bgcolor="#FFFFFF">
			<c:if test="${item.justDataType=='10'}">语音大小</c:if>
			<c:if test="${item.justDataType=='01'}">声音有无</c:if>
			<c:if test="${item.justDataType=='11'}">语音大小、声音有无</c:if>
		  </td>
          <td height="20" align="center" bgcolor="#FFFFFF">
			<a href="#" onfocus="this.blur()">
				<img onclick="toModifyType('<c:out value="${item.id}"/>','<c:out value="${item.name}"/>','<c:out value="${item.justDataType}"/>');" src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />bianji.gif" width="16" height="16" border="0" /></a></td>
          <td align="center" bgcolor="#FFFFFF">
			<a href="#" onfocus="this.blur()">
				<img onclick="deleteType('<c:out value="${item.id}"/>');" src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />de.gif" width="16" height="16" border="0" /></a></td>
        </tr>
		</c:forEach>
       

      </table>
        <jsp:include page="../../common/pagination.jsp"></jsp:include>
      </td>
        <td background="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_09.gif"><img height="1" src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />spacer.gif" width="1" /></td>
      </tr>
      <tr>
        <td><img height="22" alt="" src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_10.gif" width="7" /></td>
        <td background="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_11.gif">&nbsp;</td>
        <td><img height="22" alt="" src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_12.gif" width="8" /></td>
      </tr>
    </tbody>
  </table>
</form>
</body>
</html>
 